#include <bits/stdc++.h>
#define ll long long
using namespace std;

const int Maxn=1e5+6;
const int inf=1e9;
int n,k,d;
int h[Maxn],t[Maxn],f[Maxn];

int main(){
    freopen("holiday.in","r",stdin);
    freopen("holiday.out","w",stdout);

    scanf("%d%d%d",&n,&k,&d);
    for(int i=1;i<=n;i++)
        scanf("%d",&h[i]);
    for(int i=1;i<n;i++)
        scanf("%d",&t[i]);

    for(int i=1;i<=n;i++) f[i]=-inf;
    f[1]=h[1];

    for(int i=1;i<n;i++){
        for(int j=i+1;j<=i+t[i];j++)
            f[j]=max(f[j],f[i]-(j-i)/k*d+h[j]);
    }
    printf("%d",f[n]);
    
    system("pause");
    return 0;
}
/*
6 2 1
8 -7 -8 9 0 2
5 3 3 2 1
*/